package com.financing.platform.dao.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.stereotype.Repository;

import com.financing.platform.dao.IFpShopSubjectDao;
import com.financing.platform.dto.FpShopSubjectDTO;
import com.financing.platform.util.SqlName;

/**
 * fp_shop_subject  
 * 店铺题目表 数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopSubjectDao")
public class FpShopSubjectDaoImpl extends BaseDaoImpl implements IFpShopSubjectDao {


	@Override
	public int insert(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return (Integer) this.sqlMapClient.insert(SqlName.FpShopSubjectSql.insert, fpShopSubject);
	}

	@Override
	public void update(FpShopSubjectDTO fpShopSubject) throws SQLException {
		this.sqlMapClient.update(SqlName.FpShopSubjectSql.update, fpShopSubject);
	}

	@Override
	public void updateForce(FpShopSubjectDTO fpShopSubject) throws SQLException {
		this.sqlMapClient.update(SqlName.FpShopSubjectSql.updateForce, fpShopSubject);
	}

	@Override
	public void delete(Integer id) throws SQLException {
		this.sqlMapClient.delete(SqlName.FpShopSubjectSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopSubjectDTO> queryList(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return this.sqlMapClient.queryForList(SqlName.FpShopSubjectSql.queryList, fpShopSubject);
	}

	@Override
	public int queryListCount(FpShopSubjectDTO fpShopSubject) throws SQLException {
		return (Integer) this.sqlMapClient.queryForObject(SqlName.FpShopSubjectSql.queryListCount, fpShopSubject);
	}

	@Override
	public FpShopSubjectDTO loadById(Integer id) throws SQLException {
		return  (FpShopSubjectDTO)this.sqlMapClient.queryForObject(SqlName.FpShopSubjectSql.loadById,id);
	}

	
 	
}
